# _*_ coding: UTF-8 _*_
# @Time     : 2021/11/3 15:12
# @Author   : yangshuaishuai
# @Site     : http://www.hzdledu.cn/
# @File     : case_001_login.py
# @Software : PyCharm


import unittest
from selenium import webdriver
from web5_po.page.login_page import LoginPage
from web5_po.page.main_page import MainPage

class LoginCase(unittest.TestCase):
    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()
        self.login_page = LoginPage(self.driver)
        self.main_page = MainPage(self.driver)

    def test(self):
        self.driver.get('http://192.168.6.189/cloud/#/open/login')
        self.login_page.input_user('admin')
        self.login_page.input_pwd('123456')
        self.login_page.input_vcode('8888')
        self.login_page.click_login()

        self.main_page.move_to_icon()
        self.main_page.click_logout()

    def tearDown(self) -> None:
        self.driver.quit()